$(function() {
	$('#search_hr_level').live('click', function() {
		adminHrLevel.searchHrLevel('page');
	});
});

var adminHrLevel = (function(){

	var searchHrLevel = function(type) {
		var attr_id = $('#attr_id').val();
		var brand = $('#brand').val();
		var url = _siteUrl+'admincp/hrPositionLevel/index?search[attr_id]='+attr_id+'&search[brand]='+brand+'&search[type]='+type;
		if(type=='csv') {
			window.open(url); 	
		} else if(type=='page'){
			document.location.href = url;
		}
	}
	
	return {
		searchHrLevel : searchHrLevel
	};
	
})();